import Vue from 'vue'

import 'normalize.css/normalize.css'// A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN'

import App from './App'
import router from './router'
import store from './store'

import '@/icons' // icon
import '@/permission' // 权限
import {default as api} from './utils/api'
import directives from "@/directives";

import {hasPermission} from "./utils/hasPermission";
import JsonViewer from 'vue-json-viewer'//json视图

import mavonEditor from 'mavon-editor'//md编辑器
import 'mavon-editor/dist/css/index.css'
import '../common' // 引入全局方法或常量或过滤器等等。。。

Vue.use(JsonViewer)
Vue.use(ElementUI, {locale})
Vue.use(mavonEditor)
Vue.prototype.api = api   //为Vue对象添加了一个原型属性
//全局的常量
Vue.prototype.hasPerm = hasPermission
Vue.use(directives);

//生产环境时自动设置为 false 以阻止 vue 在启动时生成生产提示。
Vue.config.productionTip = (process.env.NODE_ENV != 'production')
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: {App}
})
